com.supermap.ar.areffect.preset
Class BaseShape
- java.lang.Object
-
- com.supermap.ar.areffect.preset.BaseShape
-
- Direct Known Subclasses:
- ARGeometry, Shape
public class BaseShape extends java.lang.ObjectBase shape class Point, line, region
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classBaseShape.MatTypeTexture types OPAQUE transparent texture TRANSPARENT opaque texturestatic classBaseShape.ModeDrawing mode TRIANGLE_FAN The first point and next two adjacent points compose a triangle.
-
Constructor Summary
Constructors Constructor and Description BaseShape(BaseShape.MatType matType)Construction method
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()Clear shapeColorgetColor()Gets the colorfloat[]getColorRGBA()Gets the RGBA value of the colorfloatgetMetallic()Gets metallicityAREffectElementgetParentElement()Get the parent nodefloatgetRadius()floatgetReflectance()Gets reflectancefloatgetRoughness()Gets roughnessColorgetSelectionColor()Gets the rendering object under the selection statusMaterialgetShapeMaterial()ShapeStylegetShapeStyle()Get style styleintgetTextureMap()Gets the resource id of the texture mapbooleanisRenderable()Renderable or not default truebooleanisSelected()Determines whether it is selectedbooleanisShadowCaster()Whether the rendered shape can generate shadowbooleanisShadowReceiver()Whether the rendered shape accepts shadowvoidselect()SelectedvoidsetColor(Color color)Sets the colorBaseShapesetColor(float r, float g, float b, float a)Sets the color through its RGBA valueBaseShapesetColor(java.lang.String colorString)Sets the colorBaseShapesetMetallic(float metallic)Sets metallicityvoidsetParentNode(AREffectElement element)Setting the parent nodevoidsetParentNode(EffectView arView)Setting the parent nodevoidsetRadius(float radius)BaseShapesetReflectance(float reflectance)Sets reflectanceSsetRenderable(boolean renderable)Sets whether the object is renderable Defaults to true, when set to false, the object drawn will not be rendered in the sceneBaseShapesetRoughness(float roughness)Sets roughnessvoidsetSelectionColor(Color color)Sets the color of the rendering object under the selection statusBaseShapesetShadowCaster(boolean shadowCaster)Sets whether to generate the shadow effectBaseShapesetShadowReceiver(boolean shadowReceiver)Sets the effect after accepting shadowvoidsetShapeStyle(ShapeStyle shapeStyle)Set style styleBaseShapesetTextureMap(int textureMap)Sets imagesvoidunSelect()Cancel the selected statusvoidupdateMaterial()Update texture
-
-
-
Constructor Detail
-
BaseShape
public BaseShape(BaseShape.MatType matType)
Construction method- Parameters:
matType- texture type (transparent/opaque)
-
-
Method Detail
-
getSelectionColor
public Color getSelectionColor()
Gets the rendering object under the selection status- Returns:
-
setSelectionColor
public void setSelectionColor(Color color)
Sets the color of the rendering object under the selection status- Parameters:
color-
-
isSelected
public boolean isSelected()
Determines whether it is selected- Returns:
-
select
public void select()
Selected
-
unSelect
public void unSelect()
Cancel the selected status
-
getRadius
public float getRadius()
-
setRadius
public void setRadius(float radius)
-
getTextureMap
public int getTextureMap()
Gets the resource id of the texture map- Returns:
-
setTextureMap
public BaseShape setTextureMap(int textureMap)
Sets images- Parameters:
textureMap-- Returns:
-
isShadowReceiver
public boolean isShadowReceiver()
Whether the rendered shape accepts shadow- Returns:
-
setShadowReceiver
public BaseShape setShadowReceiver(boolean shadowReceiver)
Sets the effect after accepting shadow- Parameters:
shadowReceiver-- Returns:
-
isShadowCaster
public boolean isShadowCaster()
Whether the rendered shape can generate shadow- Returns:
-
setShadowCaster
public BaseShape setShadowCaster(boolean shadowCaster)
Sets whether to generate the shadow effect- Parameters:
shadowCaster-- Returns:
-
getMetallic
public float getMetallic()
Gets metallicity- Returns:
-
setMetallic
public BaseShape setMetallic(float metallic)
Sets metallicity- Parameters:
metallic-- Returns:
-
getRoughness
public float getRoughness()
Gets roughness- Returns:
-
setRoughness
public BaseShape setRoughness(float roughness)
Sets roughness- Parameters:
roughness-- Returns:
-
getReflectance
public float getReflectance()
Gets reflectance- Returns:
-
setReflectance
public BaseShape setReflectance(float reflectance)
Sets reflectance- Parameters:
reflectance-- Returns:
-
getColorRGBA
public float[] getColorRGBA()
Gets the RGBA value of the color
-
getColor
public Color getColor()
Gets the color- Returns:
-
setColor
public BaseShape setColor(java.lang.String colorString)
Sets the color- Parameters:
colorString- color string, eg: "#ffffff"- Returns:
-
setColor
public void setColor(Color color)
Sets the color- Parameters:
color-
-
setColor
public BaseShape setColor(float r, float g, float b, float a)
Sets the color through its RGBA value- Parameters:
r-g-b-a-- Returns:
-
updateMaterial
public void updateMaterial()
Update texture
-
clear
public void clear()
Clear shape
-
setShapeStyle
public void setShapeStyle(ShapeStyle shapeStyle)
Set style style- Parameters:
shapeStyle- shape风格
-
getShapeStyle
public ShapeStyle getShapeStyle()
Get style style- Returns:
ShapeStylestyle
-
getShapeMaterial
public Material getShapeMaterial()
-
isRenderable
public boolean isRenderable()
Renderable or notdefault true
- Returns:
- boolean
-
setRenderable
public S setRenderable(boolean renderable)
Sets whether the object is renderableDefaults to true, when set to false, the object drawn will not be rendered in the scene
- Parameters:
renderable- boolean
-
setParentNode
public void setParentNode(AREffectElement element)
Setting the parent node- Parameters:
element-
-
setParentNode
public void setParentNode(EffectView arView)
Setting the parent node- Parameters:
arView-
-
getParentElement
public AREffectElement getParentElement()
Get the parent node- Returns:
-
-